package com.seu.spring.advance.aop;

import org.aopalliance.intercept.MethodInterceptor;

/**
 * 通知实现
 * advisedSupport封装了TargetSource, MethodInterceptor和MethodMatcher
 *
 * @author liangfeihu
 * @since 2018/12/28 17:16
 */
public class AdvisedSupport {

    /**
     * 目标对象
     * 要拦截的对象
     */
    private TargetSource targetSource;

    /**
     * 方法拦截
     * Spring的AOP只支持方法级别的调用，所以其实在AopProxy里，我们只需要将MethodInterceptor放入对象的方法调用
     */
    private MethodInterceptor methodInterceptor;

    /**
     * 方法匹配器
     * 切面规则匹配判断，判断是否是需要拦截的方法
     */
    private MethodMatcher methodMatcher;

    public TargetSource getTargetSource() {
        return targetSource;
    }

    public void setTargetSource(TargetSource targetSource) {
        this.targetSource = targetSource;
    }

    public MethodInterceptor getMethodInterceptor() {
        return methodInterceptor;
    }

    public void setMethodInterceptor(MethodInterceptor methodInterceptor) {
        this.methodInterceptor = methodInterceptor;
    }

    public MethodMatcher getMethodMatcher() {
        return methodMatcher;
    }

    public void setMethodMatcher(MethodMatcher methodMatcher) {
        this.methodMatcher = methodMatcher;
    }

}